<template>
	<view class="page-body ">
		<web-view :src="html" :webview-styles="webviewStyles" v-if="hasHtml" @message="handleMessage"></web-view>
	</view>
</template>

<script>
	var that;
	import {Pages,TimeStorage} from '@/utils/utils.js';
	import {host} from '@/utils/Config.js';
	var wv;
	export default{
		data(){
			return{
				token:"",
				html:"",
				hasHtml:false,
				webviewStyles:{
					progress:{
						 color: '#FF3333'
					}
				}
			}
		},
		onLoad(options){
			// #ifdef APP-PLUS
			plus.nativeUI.showWaiting();
			// #endif
			that=this;
			
			that.html = `${host}/findword?textcode=${options.textcode}&token=${options.token}&utoken=${TimeStorage.geted('utoken')}`
			that.hasHtml = true;
		},
		onReady(){
			// #ifdef APP-PLUS
			plus.nativeUI.closeWaiting();
			// #endif
			// #ifdef APP-PLUS
			var currentWebview = this.$mp.page.$getAppWebview() //获取当前页面的webview对象
			setTimeout(function() {
				wv = currentWebview.children()[0];
				// wv.setCssText('#backURL{display:none;}')
			}, 1000); //如果是页面初始化调用时，需要延时一下
			// #endif
		},
		onShow(options){
			
		},
		computed:{

		},
		methods:{
			handleMessage(e){
				
			}
		},
		onBackPress(options) {
			// uni.$emit('backpress')
		}
	}
	
</script>

<style lang="scss" scoped="">
	@import '../../../../static/css/user.css';
	page{background: #fff;}

</style>
